package com.huige.header;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author 朱志辉
 * @Create 2024/7/19 下午1:39
 * @Version 1.0
 * Description:   获取请求头
 */
@Controller
@RequestMapping("header")
@ResponseBody
public class HeaderController {

    @GetMapping("data")
    public String getHeader(@RequestHeader String host) {
        System.out.println("host = " + host);
        return "host = " + host;
    }
}
